JavaScript
// Enter your JavaScript code here
function calculateTotal(prices) {
let total = 0;
for (let i = 0; i < prices.length; i++) {
total += prices[i];
}
return total;
}
// Example usage
const itemPrices = [10.99, 5.50, 3.25, 8.75];
const sum = calculateTotal(itemPrices);
console.log("Total cost:", sum);